package reflecttest;

import java.lang.reflect.Array;

public class ArrayTest1 {
    public static void main(String[] args){
        Object arr = Array.newInstance(String.class,10);
        Array.set(arr,5,"java疯狂讲义");
        Array.set(arr,6,"java实战");
        Object book1 = Array.get(arr,5);
        Object book2 = Array.get(arr,6);
        System.out.println(book1);
        System.out.println(book2);

        String[] array = (String[])arr;
        System.out.println(array[5]);
        System.out.println(array[6]);
    }
}
